package wang.aweb.childcar.controller.management;

import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import wang.aweb.childcar.common.ApiRestResponse;
import wang.aweb.childcar.model.pojo.WqPage;
import wang.aweb.childcar.service.DonateService;

@RestController
@RequestMapping("/management/donate/")
public class DonateController {
    @Autowired
    private DonateService donateService;
    @PostMapping("log")
    public ApiRestResponse log(@RequestParam Integer page,@RequestParam Integer limit){
        PageInfo pageInfo=donateService.getList(page,limit);
        WqPage wqPage=new WqPage(pageInfo.getTotal(),pageInfo.getList());
        return  ApiRestResponse.success(wqPage);
    }
}
